package com.hyacinth.aurora.utils;


/**
 * Function:
 *
 * @author crossoverJie
 *         Date: 2018/9/1 17:46
 * @since JDK 1.8
 */
public class PathUtil {

    public static final String FOLDER_SEPARATOR = "/";

    public static final String WINDOWS_FOLDER_SEPARATOR = "\\";

    /**
     * Get Root Path
     * /aurora/demoAction
     * @param path
     * @return cicada-example
     */
    public static String getServerContextPath(String path) {
        return FOLDER_SEPARATOR + path.split(FOLDER_SEPARATOR)[1];
    }

    /**
     * Get Action Path
     * /aurora/demoAction
     * @param path
     * @return demoAction
     */
    public static String getActionPath(String path) {
        return path.split(FOLDER_SEPARATOR)[2];
    }


}
